<template>
  <f7-page>
    <f7-navbar title="须知管理" back-link="Back"></f7-navbar>
    <f7-list inline-labels>
      <f7-list-input
        label="酒店须知"
        type="textarea"
        resizable
        :value="provisionsadministration"
        @input="provisionsadministration = $event.target.value"
      ></f7-list-input>
      <f7-list-input
        label="酒店管理规定"
        type="textarea"
        resizable
        :value="hotelinformation"
        @input="hotelinformation = $event.target.value"
      ></f7-list-input>
    </f7-list>
    <div>
      <f7-button fill raised @click="queding">确定添加</f7-button>
    </div>
  </f7-page>
</template>
<script>
import axios from "axios";
import qs from "qs";
export default {
  data() {
    return {
      hotelinformation: "",
      provisionsadministration: ""
    };
  },
  methods: {
    queding() {
      const self = this;
      const app = self.$f7;
      axios({
        method: "post",
        url: "/caofuying/Information/insertInformation",
        data: qs.stringify({
          hotelInformation: this.hotelinformation,
          provisionsAdministration: this.provisionsadministration
        })
      }).then(r => {
        const { data } = r;
        if (data == 1) {
          app.dialog.alert(`添加成功`, () => {
            this.$f7router.back();
          });
        } else if (data == 0) {
          app.dialog.alert("添加或修改失败");
        } else if (data == 2) {
          app.dialog.alert("修改成功");
        } else {
          app.dialog.alert("服务器错误");
        }
      });
    }
  }
};
</script>
<style  scoped>
</style>
